package com.zhz.livegoods.buytime.controller;

import com.zhz.livegoods.buytime.service.BuytimeService;
import com.zhz.livegoods.commons.vo.LivegoodsResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 查询商品预订倒计时控制器
 * @author zhz
 * @date 2020/08/06
 **/
@RestController
@CrossOrigin
public class BuytimeController {
    @Autowired
    private BuytimeService buytimeService;

    /**
     * 根据商品主键查询商品预订倒计时（可预订时间）
     * @param id
     * @return
     */
    @GetMapping("/buytime")
    public LivegoodsResult getBuytimeById(String id){
        return buytimeService.getBuytimeById(id);
    }
}
